var Dog=require("./dog.js");
var dog1=new Dog({"name":"taidi",energy:4});
var dog2=new Dog({"name":"zangao",energy:8});

dog1.on("bark",()=>{
    dog1.bark();
});
dog2.on("bark",()=>{
    dog2.bark();
});

setInterval(()=>{  dog1.emit("bark");
dog2.emit("bark");},1000); 


